extends Node

var _actorArr=[]
var _value=0 #0-1
onready var _point=$Path/point
func _ready():
	G.paoHuoCheCtl=self
	pass
func _process(delta):
	_value+=0.3*delta
	if _value>1:
		_value-=1
	#更新玩家位置
	_updateActorPos()
	
func join(actor):
	if !_actorArr.has(actor):
		_actorArr.append(actor)
	pass
func leave(actor):
	_actorArr.erase(actor)
	pass
func _updateActorPos():
	var num=_actorArr.size()
	var interval=0.05
	if interval*num>=1:
		interval=1.0/num
	for i in num:
		var actor=_actorArr[i] as Actor
		var v=_value-interval*i
		_point.unit_offset=v
		actor.paoHuoChePos=_point.translation

